﻿using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;
using DevExpress.ExpressApp.DC;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.ConditionalAppearance;

namespace DomainComponents.XCRM {
    [NonPersistent]
    public class CancelOrderParameters {
        public CancelOrderParameters(IOrder order){
            this.CancelDate = DateTime.Now;
        }
        public OrderStatus Status { get; set; }
        public DateTime CancelDate { get; set; }
    }

    [DomainLogic(typeof(IOrder))]
    public class OrderCancelLogic {
        public static void Cancel(IOrder order, CancelOrderParameters parameters) {
            order.Status = parameters.Status;
            order.CancelDate = parameters.CancelDate;
        }
    }
}
